<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QtWebApp: httpserver/httpconnectionhandler.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QtWebApp
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('httpconnectionhandler_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">httpconnectionhandler.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="httpconnectionhandler_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#ifndef HTTPCONNECTIONHANDLER_H</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#define HTTPCONNECTIONHANDLER_H</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#ifndef QT_NO_SSL</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">   #include &lt;QSslConfiguration&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;QTcpSocket&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;QSettings&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;QTimer&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;QThread&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="httpglobal_8h.html">httpglobal.h</a>&quot;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="httprequest_8h.html">httprequest.h</a>&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="httprequesthandler_8h.html">httprequesthandler.h</a>&quot;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">namespace </span>stefanfrings {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#if QT_VERSION &gt;= QT_VERSION_CHECK(5, 0, 0)</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="httpconnectionhandler_8h.html#aac9d80ca2f2f3e2c74506d3b207b02d6">   24</a></span>&#160;    <span class="keyword">typedef</span> qintptr <a class="code" href="httpconnectionhandler_8h.html#aac9d80ca2f2f3e2c74506d3b207b02d6">tSocketDescriptor</a>;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keyword">typedef</span> <span class="keywordtype">int</span> <a class="code" href="httpconnectionhandler_8h.html#aac9d80ca2f2f3e2c74506d3b207b02d6">tSocketDescriptor</a>;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#ifdef QT_NO_SSL</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">  #define QSslConfiguration QObject</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="classstefanfrings_1_1HttpConnectionHandler.html">   49</a></span>&#160;<span class="keyword">class </span>DECLSPEC <a class="code" href="classstefanfrings_1_1HttpConnectionHandler.html">HttpConnectionHandler</a> : <span class="keyword">public</span> QObject {</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    Q_OBJECT</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    Q_DISABLE_COPY(<a class="code" href="classstefanfrings_1_1HttpConnectionHandler.html">HttpConnectionHandler</a>)</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <a class="code" href="classstefanfrings_1_1HttpConnectionHandler.html">HttpConnectionHandler</a>(<span class="keyword">const</span> QSettings* settings, <a class="code" href="classstefanfrings_1_1HttpRequestHandler.html">HttpRequestHandler</a>* requestHandler,</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                          <span class="keyword">const</span> QSslConfiguration* sslConfiguration=<span class="keyword">nullptr</span>);</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classstefanfrings_1_1HttpConnectionHandler.html">HttpConnectionHandler</a>();</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordtype">bool</span> isBusy();</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keywordtype">void</span> setBusy();</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keyword">const</span> QSettings* settings;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    QTcpSocket* socket;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    QThread* thread;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    QTimer readTimer;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160; </div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <a class="code" href="classstefanfrings_1_1HttpRequest.html">HttpRequest</a>* currentRequest;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <a class="code" href="classstefanfrings_1_1HttpRequestHandler.html">HttpRequestHandler</a>* requestHandler;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordtype">bool</span> busy;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keyword">const</span> QSslConfiguration* sslConfiguration;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="keywordtype">void</span> createSocket();</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="keyword">public</span> slots:</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keywordtype">void</span> handleConnection(<span class="keyword">const</span> <a class="code" href="httpconnectionhandler_8h.html#aac9d80ca2f2f3e2c74506d3b207b02d6">tSocketDescriptor</a> socketDescriptor);</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="keyword">private</span> slots:</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keywordtype">void</span> readTimeout();</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keywordtype">void</span> read();</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordtype">void</span> disconnected();</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keywordtype">void</span> thread_done();</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;};</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160; </div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;} <span class="comment">// end of namespace</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// HTTPCONNECTIONHANDLER_H</span></div>
<div class="ttc" id="aclassstefanfrings_1_1HttpConnectionHandler_html"><div class="ttname"><a href="classstefanfrings_1_1HttpConnectionHandler.html">stefanfrings::HttpConnectionHandler</a></div><div class="ttdoc">Alias for QSslConfiguration if OpenSSL is not supported.</div><div class="ttdef"><b>Definition:</b> <a href="httpconnectionhandler_8h_source.html#l00049">httpconnectionhandler.h:49</a></div></div>
<div class="ttc" id="aclassstefanfrings_1_1HttpRequestHandler_html"><div class="ttname"><a href="classstefanfrings_1_1HttpRequestHandler.html">stefanfrings::HttpRequestHandler</a></div><div class="ttdoc">The request handler generates a response for each HTTP request.</div><div class="ttdef"><b>Definition:</b> <a href="httprequesthandler_8h_source.html#l00027">httprequesthandler.h:27</a></div></div>
<div class="ttc" id="aclassstefanfrings_1_1HttpRequest_html"><div class="ttname"><a href="classstefanfrings_1_1HttpRequest.html">stefanfrings::HttpRequest</a></div><div class="ttdoc">This object represents a single HTTP request.</div><div class="ttdef"><b>Definition:</b> <a href="httprequest_8h_source.html#l00038">httprequest.h:38</a></div></div>
<div class="ttc" id="ahttpconnectionhandler_8h_html_aac9d80ca2f2f3e2c74506d3b207b02d6"><div class="ttname"><a href="httpconnectionhandler_8h.html#aac9d80ca2f2f3e2c74506d3b207b02d6">stefanfrings::tSocketDescriptor</a></div><div class="ttdeci">qintptr tSocketDescriptor</div><div class="ttdoc">Alias type definition, for compatibility to different Qt versions.</div><div class="ttdef"><b>Definition:</b> <a href="httpconnectionhandler_8h_source.html#l00024">httpconnectionhandler.h:24</a></div></div>
<div class="ttc" id="ahttpglobal_8h_html"><div class="ttname"><a href="httpglobal_8h.html">httpglobal.h</a></div></div>
<div class="ttc" id="ahttprequest_8h_html"><div class="ttname"><a href="httprequest_8h.html">httprequest.h</a></div></div>
<div class="ttc" id="ahttprequesthandler_8h_html"><div class="ttname"><a href="httprequesthandler_8h.html">httprequesthandler.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_32a529a3b2babe504aaf73e401f143d0.html">httpserver</a></li><li class="navelem"><a class="el" href="httpconnectionhandler_8h.html">httpconnectionhandler.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
